/**
 *
 * Created by sky on 16/2/3.
 */
var api=require("API");
var SHOP_API=require('API').shop;
module.exports = ['$scope',function ($scope) {

    $scope.shops={};
    //获取可用门店
    SHOP_API.all_normal(function(json){
        $scope.$apply(function(){
            $scope.shops=json;
        })
    });


    $scope.upload_after_sale=function(){
        var after_sale= new FormData(document.getElementById("form_after_sale"));

        $.ajax({
            url:"/api/excel/import",
            type:"post",
            data:after_sale,
            headers: {
                Authorization: require('AUTH').getToken()
            },
            processData:false,
            contentType:false,
            success:function(data){
                alert('提交成功！');
            },
            error:function(error){
                alert(error.responseText);
            }
        })
    };




}];
